﻿/*------------------------------------------------
// File Description: user DataBase Entity
// Author:			 汪亮
// Create Time:		 2020-02-04 03:32:51
//------------------------------------------------*/

using System;
using System.Data.Entity;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using IOA.MES.DataAccess.Enum;

namespace IOA.MES.DataAccess.Entity
{
    /// <summary>
    /// 用户表
    /// </summary>
    [Table(nameof(User))]
    public class User : BaseEntity
    {
        private string _userName = string.Empty;
        private string _email = string.Empty;
        private string _phone = string.Empty;
        private string _password = string.Empty;
        private string _avatar = string.Empty;
        private string _trueName;
        private string _language;

        #region Public Property

        ///<Summary>
        /// 用户名
        ///</Summary>
        public string UserName
        {
            get { return string.IsNullOrWhiteSpace(_userName) ? string.Empty : _userName; }
            set { _userName = value; }
        }

        ///<Summary>
        /// 真实姓名
        ///</Summary>
        public string TrueName
        {
            get { return string.IsNullOrWhiteSpace(_trueName) ? string.Empty : _trueName; }
            set { _trueName = value; }
        }

        ///<Summary>
        /// 邮箱
        ///</Summary>
        public string Email
        {
            get { return string.IsNullOrWhiteSpace(_email) ? string.Empty : _email; }
            set { _email = value; }
        }

        ///<Summary>
        /// 手机号
        ///</Summary>
        public string Phone
        {
            get { return string.IsNullOrWhiteSpace(_phone) ? string.Empty : _phone; }
            set { _phone = value; }
        }

        ///<Summary>
        /// 密码
        ///</Summary>
        public string Password
        {
            get { return string.IsNullOrWhiteSpace(_password) ? string.Empty : _password; }
            set { _password = value; }
        }

        ///<Summary>
        /// 头像
        ///</Summary>
        public string Avatar
        {
            get { return string.IsNullOrWhiteSpace(_avatar) ? string.Empty : _avatar; }
            set { _avatar = value; }
        }

        ///<Summary>
        /// 语言
        ///</Summary>
        public string Language
        {
            get { return string.IsNullOrWhiteSpace(_language) ? string.Empty : _language; }
            set { _language = value; }
        }

        /// <summary>
        /// 用户状态
        /// </summary>
        public CommonStatus Status { get; set; }
        #endregion
    }

    public partial class MESContext
    {
        /// <summary>
        /// 用户表
        /// </summary>
        public virtual DbSet<User> Users { get; set; }
    }
}